-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(serializer): validate required fields for blocks without tools #3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryFixed serializer validation bug where required fields were not validated for blocks with empty The previous implementation early-returned when
Also includes a minor formatting improvement to show "0ms" instead of "0.00ms" for zero/near-zero durations. Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Serializer
participant ValidationLogic
participant BlockConfig
participant ToolRegistry
Client->>Serializer: serializeWorkflow(blocks, validateRequired=true)
Serializer->>Serializer: serializeBlock(block)
Serializer->>Serializer: extractParams(block)
alt validateRequired is true
Serializer->>ValidationLogic: validateRequiredFieldsBeforeExecution(block, blockConfig, params)
ValidationLogic->>BlockConfig: Check if block enabled
alt Block has tools.access
ValidationLogic->>ToolRegistry: getTool(currentToolId)
ToolRegistry-->>ValidationLogic: currentTool
loop For each tool param
ValidationLogic->>ValidationLogic: Check if required & user-only
ValidationLogic->>ValidationLogic: Check visibility via shouldSerializeSubBlock
ValidationLogic->>ValidationLogic: Validate field value
end
end
Note over ValidationLogic: NEW: Secondary validation for blocks without tools
ValidationLogic->>ValidationLogic: Build validatedByTool Set
loop For each subBlock in blockConfig
alt Not validated by tool params
ValidationLogic->>ValidationLogic: Check visibility via shouldSerializeSubBlock
ValidationLogic->>ValidationLogic: Check if required
ValidationLogic->>ValidationLogic: Validate field value
end
end
alt Missing fields found
ValidationLogic-->>Serializer: throw Error(missing fields)
Serializer-->>Client: Error
else All fields valid
ValidationLogic-->>Serializer: validation passed
end
end
Serializer->>Serializer: Continue serialization
Serializer-->>Client: SerializedBlock
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
tools.access(e.g., wait block)requiredfields not covered by tool paramsType of Change
Testing
Tested manually
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Cursor Bugbot found 1 potential issue for commit 60fcaf5